//
//  TranslationFilterItemCell.swift
//  GLUZSwift
//
//  Created by xyanl on 2025/3/14.
//  Copyright © 2025 考拉🐨. All rights reserved.
//

import UIKit
import Reusable

extension TranslationFilterItemCell: NibReusable {}

class TranslationFilterItemCell: UICollectionViewCell {

    @IBOutlet weak var nameLabel: UILabel!
    
    var model: TranslationFilterModel? {
        didSet {
            guard let model = model else { return }
            
            nameLabel.text = LanguageManager.currentLanguageToText(model.name, model.nameRu)
            
            if model.isSelected {
                nameLabel.textColor = UIColor(hex: "#FFFFFF")
                nameLabel.backgroundColor = .themeColor
            } else {
                nameLabel.textColor = UIColor(hex: "333333")
                nameLabel.backgroundColor = UIColor(hex: "#F7F7F7")
            }
            
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        addRoundedCorners(radius: 16)
    }

}
